Date.prototype.format = function (fmt) {
  var o = {
    "y+": this.getFullYear, //年
    "M+": this.getMonth() + 1, //月份
    "d+": this.getDate(), //日
    "h+": this.getHours(), //小时
    "m+": this.getMinutes(), //分
    "s+": this.getSeconds() //秒
  };
  if (/(y+)/.test(fmt)) {
    fmt = fmt.replace(RegExp.$1, (this.getFullYear() + "").substr(4 - RegExp.$1.length));
  }
  for (var k in o) {
    if (new RegExp("(" + k + ")").test(fmt)) {
      fmt = fmt.replace(RegExp.$1, (RegExp.$1.length === 1) ? (o[k]) : (("00" + o[k]).substr(("" + o[k]).length)));
    }
  }
  return fmt;
};
// setInterval(() => {
//   document.getElementById('time').innerHTML = (new Date()).format('hh:mm:ss')
// }, 1000);

function change_pic() {
  // var imgObj = document.getElementById("pic");
  // var Flag = (imgObj.getAttribute("src", 2) === "images/index3/turnOn.png")
  // imgObj.src = Flag ? "images/index3/turnOff.png" : "images/index3/turnOn.png";
}

function Show() {
  document.getElementById('shade').classList.remove('hide');
  document.getElementById('modal').classList.remove('hide');
}

function Hide() {
  document.getElementById('shade').classList.add('hide');
  document.getElementById('modal').classList.add('hide');
}

function login() {
  var pwd1 = document.getElementById("pwd").value;
  var pwd = ["dalian", "changchun", "shijiazhuang", "baotou", "qinghaihu", "nantong", "guangzhou", "nanning", "hulunbeier", "dunhuang"];
  var acc1 = document.getElementById("acc").value;
  var acc = ["dalian", "changchun", "shijiazhuang", "baotou", "qinghaihu", "nantong", "guangzhou", "nanning", "hulunbeier", "dunhuang"];
  for (i = 0; i < 10; i++) {
    var pwd2 = pwd[i];
    var acc2 = acc[i];
    if (pwd1 === pwd2 && acc2 === acc1) {
      Hide();
    } else {
      // document.getElementById("loginMessage").innerHTML="<p>请重新输入</p>"
    }
  }

  document.getElementById("acc").value = "";
  document.getElementById("pwd").value = "";

}

function displayWth() {
  var mySelect = document.getElementById("statusOption");
  var index = mySelect.selectedIndex;  //选中项的索引
  var dl = document.getElementById("weather_dl");
  var sjz = document.getElementById("weather_sjz");
  var cc = document.getElementById("weather_cc");
  var bt = document.getElementById("weather_bt");
  var nt = document.getElementById("weather_nt");
  var nn = document.getElementById("weather_nn");
  var dh = document.getElementById("weather_dh");
  var gz = document.getElementById("weather_gz");
  var hlbe = document.getElementById("weather_hlbe");
  var qhh = document.getElementById("weather_qhh");
  if (mySelect.options[index].value === "dalian") {
    dl.style.display = "";
    sjz.style.display = "none";
    cc.style.display = "none";
    bt.style.display = "none";
    nt.style.display = "none";
    nn.style.display = "none";
    dh.style.display = "none";
    gz.style.display = "none";
    hlbe.style.display = "none";
    qhh.style.display = "none";
  } else if (mySelect.options[index].value === "shijiazhuang") {
    dl.style.display = "none";
    sjz.style.display = "";
    bt.style.display = "none";
    nt.style.display = "none";
    nn.style.display = "none";
    dh.style.display = "none";
    gz.style.display = "none";
    hlbe.style.display = "none";
    qhh.style.display = "none";
  } else if (mySelect.options[index].value === "baotou") {
    dl.style.display = "none";
    sjz.style.display = "none";
    cc.style.display = "none";
    bt.style.display = "";
    nt.style.display = "none";
    nn.style.display = "none";
    dh.style.display = "none";
    gz.style.display = "none";
    hlbe.style.display = "none";
    qhh.style.display = "none";
  } else if (mySelect.options[index].value === "changchun") {
    dl.style.display = "none";
    sjz.style.display = "none";
    cc.style.display = "";
    bt.style.display = "none";
    nt.style.display = "none";
    nn.style.display = "none";
    dh.style.display = "none";
    gz.style.display = "none";
    hlbe.style.display = "none";
    qhh.style.display = "none";
  } else if (mySelect.options[index].value === "dunhuang") {
    dl.style.display = "none";
    sjz.style.display = "none";
    cc.style.display = "none";
    bt.style.display = "none";
    nt.style.display = "none";
    nn.style.display = "none";
    dh.style.display = "";
    gz.style.display = "none";
    hlbe.style.display = "none";
    qhh.style.display = "none";
  } else if (mySelect.options[index].value === "qinghaihu") {
    dl.style.display = "none";
    sjz.style.display = "none";
    cc.style.display = "none";
    bt.style.display = "none";
    nt.style.display = "none";
    nn.style.display = "none";
    dh.style.display = "none";
    gz.style.display = "none";
    hlbe.style.display = "none";
    qhh.style.display = "";
  } else if (mySelect.options[index].value === "nantong") {
    dl.style.display = "none";
    sjz.style.display = "none";
    cc.style.display = "none";
    bt.style.display = "none";
    nt.style.display = "";
    nn.style.display = "none";
    dh.style.display = "none";
    gz.style.display = "none";
    hlbe.style.display = "none";
    qhh.style.display = "none";
  } else if (mySelect.options[index].value === "hulunbeier") {
    dl.style.display = "none";
    sjz.style.display = "none";
    cc.style.display = "none";
    bt.style.display = "none";
    nt.style.display = "none";
    nn.style.display = "none";
    dh.style.display = "none";
    gz.style.display = "none";
    hlbe.style.display = "";
    qhh.style.display = "none";
  } else if (mySelect.options[index].value === "guangzhou") {
    dl.style.display = "none";
    sjz.style.display = "none";
    cc.style.display = "none";
    bt.style.display = "none";
    nt.style.display = "none";
    nn.style.display = "none";
    dh.style.display = "none";
    gz.style.display = "";
    hlbe.style.display = "none";
    qhh.style.display = "none";
  } else if (mySelect.options[index].value === "nanning") {
    dl.style.display = "none";
    sjz.style.display = "none";
    cc.style.display = "none";
    bt.style.display = "none";
    nt.style.display = "none";
    nn.style.display = "";
    dh.style.display = "none";
    gz.style.display = "none";
    hlbe.style.display = "none";
    qhh.style.display = "none";
  }
}

function displayWthPic() {
  let mySelect = document.getElementById("statusOption");
  let index = mySelect.selectedIndex;  //选中项的索引
  let dl = document.getElementById("pic_dl");
  let sjz = document.getElementById("pic_sjz");
  let cc = document.getElementById("pic_cc");
  let bt = document.getElementById("pic_bt");
  let nt = document.getElementById("pic_nt");
  let nn = document.getElementById("pic_nn");
  let dh = document.getElementById("pic_dh");
  let gz = document.getElementById("pic_gz");
  let hlbe = document.getElementById("pic_hlbe");
  let qhh = document.getElementById("pic_qhh");
  if (mySelect.options[index].value === "dalian") {
    dl.style.display = "";
    sjz.style.display = "none";
    cc.style.display = "none";
    bt.style.display = "none";
    nt.style.display = "none";
    nn.style.display = "none";
    dh.style.display = "none";
    gz.style.display = "none";
    hlbe.style.display = "none";
    qhh.style.display = "none";
  } else if (mySelect.options[index].value === "shijiazhuang") {
    dl.style.display = "none";
    sjz.style.display = "";
    cc.style.display = "none";
    bt.style.display = "none";
    nt.style.display = "none";
    nn.style.display = "none";
    dh.style.display = "none";
    gz.style.display = "none";
    hlbe.style.display = "none";
    qhh.style.display = "none";
  } else if (mySelect.options[index].value === "baotou") {
    dl.style.display = "none";
    sjz.style.display = "none";
    cc.style.display = "none";
    bt.style.display = "";
    nt.style.display = "none";
    nn.style.display = "none";
    dh.style.display = "none";
    gz.style.display = "none";
    hlbe.style.display = "none";
    qhh.style.display = "none";
  } else if (mySelect.options[index].value === "changchun") {
    dl.style.display = "none";
    sjz.style.display = "none";
    cc.style.display = "";
    bt.style.display = "none";
    nt.style.display = "none";
    nn.style.display = "none";
    dh.style.display = "none";
    gz.style.display = "none";
    hlbe.style.display = "none";
    qhh.style.display = "none";
  } else if (mySelect.options[index].value === "dunhuang") {
    dl.style.display = "none";
    sjz.style.display = "none";
    cc.style.display = "none";
    bt.style.display = "none";
    nt.style.display = "none";
    nn.style.display = "none";
    dh.style.display = "";
    gz.style.display = "none";
    hlbe.style.display = "none";
    qhh.style.display = "none";
  } else if (mySelect.options[index].value === "qinghaihu") {
    dl.style.display = "none";
    sjz.style.display = "none";
    cc.style.display = "none";
    bt.style.display = "none";
    nt.style.display = "none";
    nn.style.display = "none";
    dh.style.display = "none";
    gz.style.display = "none";
    hlbe.style.display = "none";
    qhh.style.display = "";
  } else if (mySelect.options[index].value === "nantong") {
    dl.style.display = "none";
    sjz.style.display = "none";
    cc.style.display = "none";
    bt.style.display = "none";
    nt.style.display = "";
    nn.style.display = "none";
    dh.style.display = "none";
    gz.style.display = "none";
    hlbe.style.display = "none";
    qhh.style.display = "none";
  } else if (mySelect.options[index].value === "hulunbeier") {
    dl.style.display = "none";
    sjz.style.display = "none";
    cc.style.display = "none";
    bt.style.display = "none";
    nt.style.display = "none";
    nn.style.display = "none";
    dh.style.display = "none";
    gz.style.display = "none";
    hlbe.style.display = "";
    qhh.style.display = "none";
  } else if (mySelect.options[index].value === "guangzhou") {
    dl.style.display = "none";
    sjz.style.display = "none";
    cc.style.display = "none";
    bt.style.display = "none";
    nt.style.display = "none";
    nn.style.display = "none";
    dh.style.display = "none";
    gz.style.display = "";
    hlbe.style.display = "none";
    qhh.style.display = "none";
  } else if (mySelect.options[index].value === "nanning") {
    dl.style.display = "none";
    sjz.style.display = "none";
    cc.style.display = "none";
    bt.style.display = "none";
    nt.style.display = "none";
    nn.style.display = "";
    dh.style.display = "none";
    gz.style.display = "none";
    hlbe.style.display = "none";
    qhh.style.display = "none";
  }
}

